package com.tgr.shortLink.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tgr.shortLink.admin.dao.entity.UserDO;
import com.tgr.shortLink.admin.dto.req.UserLoginReqDTO;
import com.tgr.shortLink.admin.dto.req.UserRegisterRepDTO;
import com.tgr.shortLink.admin.dto.req.UserUpdateRepDTO;
import com.tgr.shortLink.admin.dto.resp.UserLoginRespDTO;
import com.tgr.shortLink.admin.dto.resp.UserRespDTO;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 用户接口层
 */

public interface UserService extends IService<UserDO> {
    UserRespDTO getUserByUsername(String username);

    /**
     * 查询用户是否存在
     * @param username 用户名
     * @return 存在返回true,不存在返回false
     */
    Boolean hasUsername(String username);

    /**
     * 用户注册
     * @param requestParam 用户注册请求参数
     */
    void register(UserRegisterRepDTO requestParam);

    void update(@RequestBody UserUpdateRepDTO requestParam);

    UserLoginRespDTO login(@RequestBody UserLoginReqDTO requestParam);

    Boolean checkLogin();

    void logout();
}
